home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------------------------------------------------
- -- Weapon Power Jump
- -- Original Carnage Contest Weapon
- -- Script by DC, September 2009, www.UnrealSoftware.de
- --------------------------------------------------------------------------------
-
- -- Setup Tables
- if cc==nil then cc={} end
- cc.powerjump={}
-
- -- Load & Prepare Ressources
- cc.powerjump.gfx_wpn=loadgfx("weapons/powerjump.png") -- Weapon Image
- setmidhandle(cc.powerjump.gfx_wpn)
- cc.powerjump.sfx_powerjump=loadsfx("swish.ogg") -- Sound
-
- --------------------------------------------------------------------------------
- -- Weapon: Power Jump
- --------------------------------------------------------------------------------
-
- cc.powerjump.id=addweapon("cc.powerjump","Power Jump",cc.powerjump.gfx_wpn,3) -- Add Weapon (3 uses)
- cc.powerjump.ammo=1 -- 1 Powerjump
-
- function cc.powerjump.draw() -- Draw
- if cc.powerjump.ammo-weapon_shots>0 then
- -- HUD Crosshair
- hudcrosshair(6,3)
- end
- end
-
- function cc.powerjump.attack(attack) -- Attack
- if weapon_timer>0 then
- weapon_timer=weapon_timer-1
- end
- if (weapon_shots<cc.powerjump.ammo) and (attack==1) and (weapon_timer<=0) then
- -- Use weapon and allow to use another one afterwards (1)
- useweapon(1)
- weapon_shots=weapon_shots+1
- weapon_timer=20
- -- FX
- playsound(cc.powerjump.sfx_powerjump)
- particle(p_muzzle,getplayerx(0),getplayery(0))
- particlesize(1,1)
- particlecolor(255,255,0)
- particlealpha(0.5)
- particlefadealpha(0.03)
- -- Push (absolute, don't push others)
- playerpush(0,math.sin(math.rad(getplayerrotation(0)))*7.0,-math.cos(math.rad(getplayerrotation(0)))*7.0,1,0)
- end
- if weapon_shots>0 then
- -- Avoid Falldamage
- if getplayeryspeed(0)>7.0 then
- playerpush(0,getplayerxspeed(0),7.0,1,0)
- end
- end
- end